package two_xia.ex9.Demo11;

public class VisitorPattern {
    public static void main(String[] args) {
        RegularEmployee regularEmployee = new RegularEmployee("张三", 45, 5000);
        TempEmployee tempEmployee = new TempEmployee("李四", 35, 150);

        Visitor hrVisitor = new HRVisitor();
        regularEmployee.accept(hrVisitor);
        tempEmployee.accept(hrVisitor);

        ((HRVisitor) hrVisitor).printSummary();
    }
}